package com.qk.management.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface RoleMapper {
    Integer count(@Param("name") String name,
                  @Param("label") Integer label);

    List<Role> selectPage(
            @Param("name") String name,
            @Param("label") Integer label,
            @Param("offset") Integer offset,
            @Param("pageSize") Integer pageSize);
    @Insert("insert into role(name,label,create_time,update_time) values(#{name},#{label},#{createTime},#{updateTime})")
    void insert(Role role);
    @Select("select * from role where id = #{roleid}")
    Role selectById(Integer id);

    void update(Role role);
    @Delete("delete from role where id = #{id}")
    void deleteById(Integer id);
    @Select("select * from role")
    List<Role> getAllRoles();
    @Select("select * from role where label = #{rolelabel}")
    Role selectByLabel(String roleLabel);
}
